﻿@if(ViewBag.NoLayout == true)
{
    <style>
        .EmployeeLoginNameBox {
            z-index: 10000;
            position: absolute;
            right: 0;
            top: 0;
            color: blue; 
            padding-right: 20px;
            font-size: x-small;
            background: rgba(204, 204, 204, 0.50);
            visibility: hidden; /* this is hidden because, this feature is to check login between module from Ess Message Popup to Web.Gims, 
                verify that the user is right (same as Ess). i notice that user alway right and not need to show for check more*/
        }
    </style>
    <script type="text/javascript">
        function moveBox(e) {
            var empBox = $('.EmployeeLoginNameBox');
            var mouseX = e.pageX;
            var mouseY = e.pageY;
            var docWidth = $(document).width();
            var employeeLoginNameBoxWidth = empBox.width();
            var employeeLoginNameBoxHeight = empBox.height();
            var areaToMoveBoxToLeftX = docWidth - employeeLoginNameBoxWidth - 20;   // 1000 - 100 - 100 = 800
            var areaToMoveBoxToLeftY = employeeLoginNameBoxHeight + 20;             // 50 + 100 = 150
            if (mouseX > areaToMoveBoxToLeftX && mouseY < areaToMoveBoxToLeftY) {
                // move box to top left
                moveBoxLeft(empBox);
            } else {
                // move box to top right
                moveBoxRight(empBox);
            }
            // alert(mouseX + "," + mouseY);
        }
        
        function moveBoxRight(empBox) {
            empBox.css({
                'right': '0',
                'left': 'auto'
            });
        }
        function moveBoxLeft(empBox) {
            empBox.css({
                'right': 'auto',
                'left': '0'
            });
        }

        $(document).ready(function() {
            $(document).mousemove(moveBox);
            $(document).mouseout(function () {
                moveBoxRight($('.EmployeeLoginNameBox'));
            }); 
        });
        

    </script>
    <div class="EmployeeLoginNameBox">
        @GimsMembership.Employee.FullName
    </div>
    
}  